cmake_minimum_required(VERSION 3.1)
project(test C)
find_package ( Threads REQUIRED )
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
macro(use_c99)
    if (CMAKE_VERSION VERSION_LESS "3.1")
        if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
            set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
        endif ()
    else()
        set(CMAKE_C_STANDARD 99)
    endif ()
endmacro(use_c99)
add_executable(server server.c)
add_executable(client client.c)
target_link_libraries(server ${CMAKE_THREAD_LIBS_INIT})

